package co.edu.poli.ficb.agl.automatable.gui;

import org.apache.commons.collections15.Predicate;

import co.edu.poli.ficb.agl.automatable.graph.Arista;
import co.edu.poli.ficb.agl.automatable.graph.Vertice;
import co.edu.poli.ficb.agl.automatable.modelo.automatas.Automata;
import co.edu.poli.ficb.agl.automatable.modelo.automatas.AutomatasUtil;
import co.edu.poli.ficb.agl.automatable.modelo.automatas.EstadoImpl;
import edu.uci.ics.jung.graph.Graph;
import edu.uci.ics.jung.graph.util.Context;

public class PA2EdgeIncludePredicate implements Predicate<Context<Graph<Vertice,Arista>,Arista>> {
	
	private Automata automata;
	
	public PA2EdgeIncludePredicate (Automata automata) {
		this.automata = automata;
	}
	
	@Override
	public boolean evaluate(Context<Graph<Vertice, Arista>, Arista> context) {
		return true || !AutomatasUtil.esEstadoError(automata, new EstadoImpl(context.element.getEtiqueta()));
	}
}
